package com.aaa.boot.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author MK
 * @version 1.0
 * 创建时间：2025/3/14 18:15
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AjaxResult {
    private Integer code;
    private String msg;
    private Object data;


    public AjaxResult(Integer code,String msg){
        this.code=code;
        this.msg=msg;
    }
    public AjaxResult(Integer code,Object data){
        this.code=code;
        this.data=data;
    }
    public static AjaxResult success(){
        return new AjaxResult(200,"success");
    }

    public static AjaxResult fail(){
        return new AjaxResult(301,"fail");
    }

    public static AjaxResult error() {
        return new AjaxResult(400,"error");
    }

}
